package models

import (
	"iris/db"
)

type AuthInfo struct {
	Id   int    `json:"id"`
	Pass string `json:"pass"`
}

// 身份验证
func CheckLogin(data map[string]string) AuthInfo {

	mysql := db.Mysql()

	account := data["account"]

	// 存储数据
	var allRow AuthInfo

	// 查询数据
	sql := "select `id`,`pass` from auth where `account` = ? LIMIT 1"
	mysql.Get(&allRow, sql, account)

	return allRow
}
